class Page5 extends BaseScreen {
    public constructor() {
        super();
        this.skinName = "resource/eui_skins/Page5Skin.exml";
    }

    private img_1: eui.Image;
    private img_2: eui.Image;
    private img_3: eui.Image;
    private img_4: eui.Image;
    private img_2_y: number = 0;
    private img_1_y: number = 0;

    protected childrenCreated(): void {
        super.childrenCreated();
        this.init_view();
    }

    public init_view() {
        this.resetui();
    }

    public resetui(){
        this.img_1.alpha = 0
        this.img_2.scaleY = 0;
        this.img_3.alpha = 0;
        this.img_4.alpha = 0;
        // this.img_4.x = -this.img_4.width;
        // this.img_5.scaleX = this.img_5.scaleY = 0;

        // this.img_6.x = -this.img_6.width;
        // this.img_7.scaleX = this.img_7.scaleY = 0;

        // this.img_8.alpha = 0;

        // this.img_9.x = -this.img_9.width;
        // this.img_10.scaleX = this.img_10.scaleY = 0;

        // this.img_11.x = -this.img_11.width;
        // this.img_12.scaleX = this.img_12.scaleY = 0;

        // this.img_13.x = -this.img_13.width;
        // this.img_14.scaleX = this.img_14.scaleY = 0;
         if(this.xx_page){
            this.xx_page.stop();
        }
    }

    public showPage() {
        super.showPage();
        
        this.resetui();

        egret.Tween.get(this.img_1).to({ alpha:1}, 2000);
        egret.Tween.get(this.img_2).wait(200).to({ scaleY:1}, 1000,egret.Ease.backOut);
        egret.Tween.get(this.img_3).wait(800).to({alpha:1}, 1600,egret.Ease.backOut);
        egret.Tween.get(this.img_4).wait(1200).to({alpha:1}, 1600,egret.Ease.backOut);
        // egret.Tween.get(this.img_4).wait(300).to({ x:0}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_5).wait(1300).to({ scaleX:1,scaleY:1}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_6).wait(600).to({ x:0}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_7).wait(1600).to({ scaleX:1,scaleY:1}, 1000,egret.Ease.backOut);

        // egret.Tween.get(this.img_8).wait(900).to({ alpha:1}, 1000);

        // egret.Tween.get(this.img_9).wait(1200).to({ x:0}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_10).wait(2200).to({ scaleX:1,scaleY:1}, 1000,egret.Ease.backOut);

        // egret.Tween.get(this.img_11).wait(1500).to({ x:0}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_12).wait(2500).to({ scaleX:1,scaleY:1}, 1000,egret.Ease.backOut);

        // egret.Tween.get(this.img_13).wait(1800).to({ x:0}, 1000,egret.Ease.backOut);
        // egret.Tween.get(this.img_14).wait(2800).to({ scaleX:1,scaleY:1}, 1000,egret.Ease.backOut);

        if(this.xx_page){
            this.xx_page.start();
        }
    }

    public resize(): void {
         super.resize();
    }
}